www.gusucode.com > 6KBBS ASP版 V7.1 > 6KBBS ASP版 V7.1\code\bbs\bbsShow.asp
<!--#include file="up.asp"--><!--#include file="inc/grade.asp"--><!--#include file="inc/page.asp"--> <link rel="stylesheet" type="text/css" href="skin/<%=Cssstyleid%>/bbs.css"> <%dim action,ii,name,pic,info,nn,strt if isnull(lguserid) or lguserid="" then response.redirect"login.asp" action=request.querystring("action") select case action case"" %> <div class=bbsshowtitle>发表帖子</div> <div class=bbsshowbody> <table border="0" cellpadding="0" cellspacing="0" style="border-collapse: collapse" width="100%"> <tr> <td width="20%"> <p style="margin: 5"><b>论坛排行榜:</b></td> <td width="20%"> <p style="margin: 5"><a href="bbsshow.asp?action=topmark">论坛积分前10名</a> </td> <td width="20%"> <p style="margin: 5"><a href="bbsshow.asp?action=topbbs">10大热门帖子</a></td> <td width="20%"> <p style="margin: 5"> </td> <td width="20%"> </td> </tr> <tr> <td width="20%"> <p style="margin: 5"><b>论坛图片集:</b></td> <td width="20%"> <p style="margin: 5"><a href="bbsshow.asp?action=pic">所有图片</a></td> <td width="20%"> <p style="margin: 5"><a href="bbsshow.asp?action=top10pic">10大热门图片</a></td> <td width="20%"> <p style="margin: 5"> </td> <td width="20%"> </td> </tr> <tr> <td width="20%"> <p style="margin: 5"><b>论坛Flash集:</b></td> <td width="20%"> <p style="margin: 5"><a href="bbsshow.asp?action=flash">所有Flash</a></td> <td width="20%"> <p style="margin: 5"><a href="bbsshow.asp?action=top10flash">10大热门Flash</a></td> <td width="20%"> <p style="margin: 5"> </td> <td width="20%"> </td> </tr> <tr> <td width="20%"> <p style="margin: 5"><b>论坛文件集:</b></td> <td width="20%"> <p style="margin: 5"><a href="bbsshow.asp?action=file">所有文件</a></td> <td width="20%"> <p style="margin: 5"><a href="bbsshow.asp?action=top10file">10大热门文件</a></td> <td width="20%"> <p style="margin: 5"> </td> <td width="20%"> </td> </tr><form method="GET" name="form"> <tr> <td width="20%"> <p style="margin: 5"><b>搜索用户文件集:</b></td> <td width="80%" colspan="4"> <p style="margin: 5"><input type="text" name="name" size="20" value="请输入查询的用户名"> <select size="1" name="action" style="font-size: 9pt"> <option selected>文件类型</option> <option value="picuser">图片集</option> <option value="flashuser">Flash集</option> <option value="fileuser">文件集</option> </select> <input type="submit" value=" 查 询 "></td> </tr></form> </table> </div> <%case"topmark" dim allmark i=0 set rs=conn.execute("select top 10 userid,name,mark,grade,alltopicnum from [user] order by mark desc,lasttime desc") do while not rs.eof i=i+1 if i>10 then exit do allmark=int(allmark)+rs("mark") rs.movenext loop %> <div class=bbsshowtitle>论坛积分前10名</div> <div class=bbsshowbody> <table class="bbsshowtop"> <tr> <td width="20%" height="28"> 用户名:</td> <td width="40%"> 当前积分:</td> <td width="25%"> 论坛等级:</td> <td width="15%"> 发表帖数:</td> </tr> <% i=0 rs.movefirst do while not rs.eof i=i+1 if i>10 then exit do response.write"<tr><td width=20% height=28> <a href=userinfo.asp?userid="&rs("userid")&">"&rs("name")&"</a></td><td width=40% > "&rs("mark")&"<br> <img border=0 src=images/voteline.gif width='"&rs("mark")/allmark*80&"%' height=8></td><td width=25% >"&rs("grade")&" [ ":gradename(rs("grade")):response.write" ]<p style='margin:5px'><img border=0 src=images/grade/"&rs("grade")&".gif></td><td width=15% > "&rs("alltopicnum")&"</td></tr>" rs.movenext loop %></table> </div> <% set rs=nothing %> <%case"topbbs" dim topicinfo,retopic,reinfo,renum,hot,repage,width,face,n set rs=conn.execute("select top 10 * from topic where type<>3 order by renum desc,edittime desc") %> <div class=topictop><div class=tface>表情</div><div class=ttopic>主题 (点击表情在新窗口打开)</div><div class=tauthor>作者</div><div class=thits>回复/人气</div><div class=tlastre>最后回复</div></div> <%i=0 do while not rs.eof i=i+1 if i>10 then exit do topicinfo=rs("topicinfo") topicinfo=split(topicinfo,"|") retopic=rs("retopic") if isnull(retopic) or retopic="" then reinfo="——" retopic="未有人回复。|——|0" retopic=split(retopic,"|") else retopic=split(retopic,"|") reinfo="<a href=userinfo.asp?userid="&retopic(2)&">"&checktitle(retopic(1))&"</a>" end if renum=rs("renum") hot=checknum(application(prefix&"showbbspage")) if renum/hot>(renum\hot) then repage=(renum\hot)+1 else repage=renum\hot end if width=35 face=topicinfo(0) if rs("type")=1 then face="jing" if rs("type")=2 then face="lock" if rs("top")=1 then face="top" if rs("top")=2 then face="alltop" if repage>1 then width=25 response.write"<div class=topiclist><div class=tlface><img border=0 src=images/face/"&face&".gif></div><div class=tltopic><a target=_blank href='showbbs.asp?bd="&rs("bd")&"&id="&rs("id")&"&totable="&rs("totable")&"' title='最后回复:"&checktitle(retopic(0))&"'>"&topicinfo(3)&" <font color="&replacecolor(checktitle(topicinfo(1)))&">"&lefttrue(checktitle(topicinfo(1)),width)&"</font></a>" if repage>1 then response.write" <img align=absmiddle border=0 src=images/hot.gif> <span class=hotfont>[</span><b> " if repage<=4 then for n=1 to repage response.write"<a target=_blank href=showbbs.asp?id="&rs("id")&"&bd="&rs("bd")&"&totable="&rs("totable")&"&topage="&n&"><span class=hotfont>"&n&"</span></a> " next else for nn=1 to 3 response.write"<a target=_blank href=showbbs.asp?id="&rs("id")&"&bd="&rs("bd")&"&totable="&rs("totable")&"&topage="&nn&"><span class=hotfont>"&nn&"</span></a> " next response.write"... <a target=_blank href=showbbs.asp?id="&rs("id")&"&bd="&rs("bd")&"&totable="&rs("totable")&"&topage="&repage&"><span class=hotfont>"&repage&"</span></a> " end if response.write" </b><span class=hotfont>]</span>" end if response.write"</div><div class=tlauthor><a href=userinfo.asp?userid="&rs("userid")&">"&checktitle(topicinfo(2))&"</a></div><div class=tlhits>"&renum&"/"&rs("hits")&"</div><div class=tllastre>"&reinfo&"<br><span class=tllasttime>"&rs("edittime")&"</span></div></div>" rs.movenext loop set rs=nothing %> <%case"pic","top10pic","picuser","flash","top10flash","flashuser","file","top10file","fileuser" dim sql,pagesetup,totalpage,count,pagecount,iii name=replace(request.querystring("name"),"'","") if action="pic" then sql="select*from [upload] where (filetype='.gif' or filetype='.jpg'or filetype='.bmp'or filetype='.png') and bbsid>0 order by id desc":strt="论坛图片集" if action="top10pic" then sql="select top 10 * from [upload] where (filetype='.gif' or filetype='.jpg'or filetype='.bmp'or filetype='.png') and bbsid>0 order by hits desc,id desc":strt="论坛图片集" if action="picuser" then if checkname(name)=false then response.write"你执行了非法的操作,程序终止。":response.end sql="select*from [upload] where (filetype='.gif' or filetype='.jpg'or filetype='.bmp'or filetype='.png') and name='"&name&"' and bbsid>0" strt="论坛图片集" end if if action="flash" then sql="select*from [upload] where filetype='.swf' and bbsid>0 order by id desc":strt="论坛Flash集" if action="top10flash" then sql="select top 10 * from [upload] where filetype='.swf' and bbsid>0 order by id desc":strt="论坛Flash集" if action="flashuser" then if checkname(name)=false then response.write"你执行了非法的操作,程序终止。":response.end sql="select*from [upload] where filetype='.swf' and name='"&name&"' and bbsid>0 order by id desc" strt="论坛Flash集" end if if action="file" then sql="select*from [upload] where (filetype='.rar' or filetype='.zip') and bbsid>0 order by id desc":strt="论坛文件集" if action="top10file" then sql="select top 1 * from [upload] where (filetype='.rar' or filetype='.zip') and bbsid>0 order by id desc":strt="论坛文件集" if action="fileuser" then if checkname(name)=false then response.write"你执行了非法的操作,程序终止。":response.end sql="select*from [upload] where (filetype='.rar' or filetype='.zip') and name='"&name&"' and bbsid>0 order by id desc" strt="论坛文件集" end if %> <div class=bbsshowtitle><%=strt%></div> <div class=bbsshowbody> <% dim wzcount,wzrep,wzpagecount,wzpage,pagestr,urlstr wzrep=10 urlstr="action="&action set rs = server.createobject("adodb.recordset") rs.Open sql,conn,1 if rs.eof or rs.bof then response.write"<div class=norecord>暂无记录</div>" else wzcount=rs.recordcount wzpagecount = abs(int(-abs(wzcount/wzrep))) wzpage = clng(request.querystring("page")) if len(wzpage) = 0 or wzpage = 0 then wzpage = 1 rs.absoluteposition=rs.absoluteposition+((abs(wzpage)-1)*wzrep) pagestr="每页<font color=red>"&wzrep&"</font>条 共<font color=red>"&wzpagecount&"</font>页 ["&pagination(wzpagecount,urlstr)&"] " for i = 0 to wzrep-1 if rs.eof then exit for if rs("bbsid")=0 then info="||没有相关的说明。" else info=rs("url") end if info=split(info,"|") pic=rs("filename") if rs("filetype")=".swf" then pic="../images/swf.gif" if rs("filetype")=".rar" or rs("filetype")=".zip" then pic="../images/rar.gif" %> <div class=bbsshowfile> <div class=bbsshowpic><a target="_blank" href="paper.asp?action=showpic&id=<%=rs("id")%>&picurl=<%=rs("filename")%>"><img src=upload/<%=pic%> width="100" height="100" style="border: 1px solid #C0C0C0"></a></div> <div class=bbsshowword><p style="margin: 4; line-height:120%"><%if usertype>=3 then%><a title=编辑 href="bbsshow.asp?action=edit&id=<%=rs("id")%>">[编辑]</a> <a title=删除 href="bbsshow.asp?action=del&id=<%=rs("id")%>">[删除]</a><br><%end if%>作者:<%=checktitle(rs("name"))%><br>时间:<%=rs("uploadtime")%><br>点击:<%=rs("hits")%><br>说明:<%=checktitle(info(2))%><br><%if rs("bbsid")=0 then:response.write"<font color=#808080>没有相关帖子</font>":else:response.write"<a href=showbbs.asp?bd="&info(0)&"&id="&info(1)&"&totable="&rs("totable")&">查看相关帖子</a>":end if%></div> </div> <% rs.movenext next end if rs.Close set rs=nothing response.write"<div class=bbsshowpagestr>"&pagestr&"</div>" %> </div> <%case"edit" set rs=conn.execute("select top 1 * from upload where id="&id&"") url=rs("url") url=split(url,"|") pic=rs("filename") if rs("filetype")=".swf" then pic="../images/swf.gif" if rs("filetype")=".rar" or rs("filetype")=".zip" then pic="../images/rar.gif" %> <div class=bbsshowtitle>编辑文件信息</div> <div class=bbsshowbody> <form method="POST" action="bbsshow.asp?action=editok&id=<%=id%>"> <div align="center"> <table border="0" cellpadding="0" style="border-collapse: collapse" width="100%" height="28"> <tr> <td width="25%" valign="top"> <p style="margin: 5">文件预览:</td> <td width="75%"> <p style="margin: 5"><a target="_blank" href="paper.asp?action=showpic&id=<%=rs("id")%>&picurl=<%=rs("filename")%>"><img src=upload/<%=pic%> width="100" height="100" style="border: 1px solid #C0C0C0"></a></td> </tr> <tr> <td width="25%"> <p style="margin: 5">相关帖子所在的版面:</td> <td width="75%"> <p style="margin: 5"><%dim bdlist2 set bdlist2=conn.execute("select * from bdinfo where followid<>0 order by orders desc,id") response.write"<select size=1 name=bd style='font-size: 9pt'>" do while not bdlist2.eof response.write"<option value="&bdlist2("id")&"":if int(url(0))=bdlist2("id") then:response.write" selected":end if:response.write">"&split(bdlist2("bdinfo"),"|")(0)&"</option>" bdlist2.movenext Loop response.write"</select>" set bdlist2=nothing %></td> </tr> <tr> <td> <p style="margin: 5">相关帖子的 ID:</td> <td> <p style="margin: 5"> <input type="text" name="id2" size="20" value="<%=url(1)%>"></td> </tr> <tr> <td> <p style="margin: 5">文件点击次数:</td> <td> <p style="margin: 5"> <input type="text" name="hits" size="20" value="<%=rs("hits")%>"></td> </tr> <tr> <td valign="top"> <p style="margin: 5">文件介绍:</td> <td> <p style="margin: 5"> <input type="text" name="intro" size="70" value="<%=checktitle(url(2))%>" maxlength="40"></td> </tr> <tr> <td colspan="2" align="center" height="30"> <p style="margin: 5"><input type="submit" value=" 确 认 修 改 " name="B1"></td> </tr> </table></div> </form></div> <% set rs=nothing %><%case"editok" if usertype>=3 then dim id2,hits,intro bd=checknum(request.form("bd")) id2=checknum(request.form("id2")) hits=checknum(request.form("hits")) intro=replace(request.form("intro"),"'","''") if hits="" or hits<0 then hits=0 url=bd&"|"&id2&"|"&intro conn.execute("update upload set url='"&url&"',hits="&hits&" where id="&id&"") call sendinfo("修改成功","·文件信息修改成功<br>·<a href=bbsshow.asp>回到论坛展区</a>") end if %><%case"del" if usertype>=3 then conn.execute("update upload set bbsid=0 where id="&id&"") call sendinfo("删除成功","·文件删除成功<br>·<a href=bbsshow.asp>回到论坛展区</a>") end if %><%end select call down%>